package org.reenscape.sock;
import java.net.*;
/**
* Handles connections for server status websites that don't send any data to prevent null logins. Mainly used on the server site.
*/
public class Status
{
  /**
    * Port socket runs on.
    */
  private static int SocketPort = 43596;
  
  /**
  * Socket connected computer uses.
  */
  private static Socket sock;
  
  /**
  * Accepts connections
  */
  private static ServerSocket serversock;
  
  /**
  * Launches listener thread
  */
  public static void go() {
    Runnable r = new Accepter();
    Thread t = new Thread(r);
    t.start();
  }
  /**
  * Accepter class that handles null connections.
  */
  public static class Accepter implements Runnable {
    public void run() {
      try {
        serversock = new ServerSocket(SocketPort);
        while(true) {
          sock = serversock.accept();
        }
      } catch(Exception e) { }
    }
  }
}